package com.ruoyi.system.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Invite;
import com.ruoyi.system.service.IInviteService;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 邀请信息管理Controller
 */
@RestController
@RequestMapping("/system/invite")
public class InviteController extends BaseController {
    @Autowired
    private IInviteService inviteService;

    /**
     * 查询邀请信息管理列表
     */
//    @PreAuthorize("@ss.hasPermi('system:invite:list')")
    @GetMapping("/list")
    public TableDataInfo list(Invite invite) {
        startPage();
        List<Invite> list = inviteService.selectInviteList(invite);
        return getDataTable(list);
    }

    /**
     * 删除邀请信息管理
     */
//    @PreAuthorize("@ss.hasPermi('system:invite:remove')")
    @Log(title = "邀请信息管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids) {
        return toAjax(inviteService.deleteInviteByIds(ids));
    }
}
